All Questions
6 questions
4votes
2answers
165views
Sort a dict by keys, assuming keys are orderable
I found a suspicious code snipped in an existing project in which I am involved as a developer. The code sorts a dict by its keys, so that if iterated over the dict,...
1vote
1answer
107views
Unscramble words faster in Python
So I'm currently using python to unscramble words that are retrieved from an OCR program, and checked in the 'dictionary'. The current code I am using to unscramble words is this: ...
3votes
2answers
9kviews
Sort dictionary by increasing length of its values
Given a dictionary where the values are iterables, print the dictionary sorted by the length of its values. ...
5votes
1answer
4kviews
Ranking players in a league by sorting the contents of an OrderedDict
I'm new to python. I'm having second thoughts on my approach to this problem: The LeagueTable class tracks the score of each player in a league. After each game, the player records their score with ...
5votes
1answer
254views
Finding added keys, removed keys, and unchanged keys in ordereddict
I'm comparing two OrderedDict objects and I need to find added keys, removed keys, and keys that are present in both (the intersection). Sets are designed for ...
2votes
1answer
1kviews
Clustering similar tweets in a corpus
I am attempting to write a statistical program using an LDA model I've trained/created using Gensim. I am very new to Python and am a student level programmer. This current program is working and ...